package com.future.email.controller;

import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 邮件控制器
 *
 * @author shiyong
 * 2022/2/16 9:32
 */
@RestController
@RequestMapping("/emailInfo")
@Slf4j
public class EmailInfoController {

    /**
     * 发送邮件
     *
     * @param email 邮件地址
     * @param content 邮件内容
     * @return com.alibaba.fastjson.JSONObject
     * @author shiyong
     * 2022/2/16 9:35
    */
    @PostMapping("/sendEmail")
    public JSONObject sendEmail(String email, String content) {
        log.info("向" + email + "发送邮件");
        log.info("邮件内容：" + content);

        JSONObject result = new JSONObject();
        result.put("msg", "向" + email + "发送邮件成功");
        return result;
    }
}
